<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\section{getenv --- Get Environmental Variable}
\label{fn:getenv}
\index{getenv()}
\index{Environmental variables}
\index{Getting environmental variables}
\index{variables!environmental}
\begin{rail}
GetEnv : 'getenv' '(' String  ')' ;
\end{rail}

\verb+getenv+ searches the environment list for a string that matches
the string argument.  The value of the environment variable is returned
as a string. 

The \verb+getenv+ function is mostly a wrapper around the C language
function of the same name.  This means that its behavior  depends
upon the underlying implementation. On systems with ISO C libraries, 
\verb+getenv+ will return a zero length string if the environment
variable does not exist. 

\paragraph{Example}
\index{example of getenv()}
\index{getenv()!example}
\begin{verbatim}
&gt; getenv("HOME")
/home/bradh
&gt; getenv("NOT_HOME")

&gt; my_name = getenv("LOGNAME")
 my_name =
bradh
&gt; my_machine = getenv("HOSTTYPE")
 my_machine =
i386
\end{verbatim}

\newpage






</pre></body></html>